<div ng-controller="NoticeInfoC">
    <div class="bg-light lter b-b wrapper-md">
        <a href="/download/内部系统使用说明.docx" style="color: #00a8f3;font-size: 20px">下载帮助文档</a>
    </div>
    <div class="bg-light lter b-b wrapper-md">
        <h3 class="m-n font-thin h3">我的消息</h3>
        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 input-group">
            <span class="input-group-addon">开始时间:</span>
            <input type="date" class="form-control" placeholder="按日期查找" ng-model="qTime">
            <span class="input-group-addon">结束时间:</span>
            <input type="date" class="form-control" placeholder="按日期查找" ng-model="qTime1">
             <span class="input-group-btn">
                        <button class="btn btn-default" type="button" ng-click="find()">查找</button>
            </span>
        </div>
    </div>
    <a ng-repeat="item in noticeInfos">
        <div class="container-fluid" style="padding:10px auto; border-bottom: solid #999 2px">
            <div class="row">
                <div class="col-xs-6">{{item.Content}}</div>
            </div>
        </div>
    </a>
    <div class="row text-center">
        <div class="panel-heading" my-pagination get-page-data="getData" mypagedata="pageData"></div>
    </div>
</div>
<script>
    angular.module('app') //锁价单列表控制器
    .controller("NoticeInfoC", function ($scope, $state, $http,toSave) {
        $scope.pageData = {};
        $scope.pageData.Page = 0;
        $scope.state = "";
        $scope.qTime = new Date();
        $scope.qTime1 = new Date();
        $scope.pageData.Rows = $scope.defPageRows;
        $scope.getData = function (p, r) {
            if (p) {
                p = p < 1 ? 1 : p;
            } else p = 1;
            if (r) {
            } else r = $scope.defPageRows;
            toSave.save_pages_lis(p,r);//保存当前页码和条数
         
            $http({
                url: "../api/NoticeInfo/MyList" ,
                method: "GET",
                params: { page: p, rows: r, startTime: $scope.qTime, endTime: $scope.qTime1 }
            })
            .then(function (res) {
                $scope.noticeInfos = res.data.Data;
                $scope.pageData = res.data;
                    console.log($scope.pageData);
                })
            .then(function (error) {
                if (error) {
                    alert("数据获取失败");
                }
            });
        };
            $scope.find = function () {
                    $scope.getData(1, $scope.rows);
           };
        //加载数据
        $scope.getData(toSave.get_pages(), $scope.pageData.Rows);
        console.log(toSave.get_pages());

    })
</script>  
<script src="js/services/toSave.js"></script>
